﻿using System.Net;

namespace Comdiv.QWeb.Remoting {
	public static class Connections {
		public static IQWebConnection Create(string url, ICredentials credentials = null) {
			IQWebConnection result;
			if (url == "(local)") {
				result = new LocalConnection(QWebServiceRegistry.Default);
			}
			else {
				result = new RemoteConnection(url);
			}
			result.SetCredentials(credentials);
			return result;
		}
	}
}